<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img class="banner-img" src="//img1.qunarzz.com/sight/p0/1510/23/23fa69e071d77b48.water.jpg_600x330_28ffb488.jpg"/>>
      <div class="banner-info">
        <div class="info-title">成都环球中心</div>
        <div class="info-number"><span class="iconfont info-icon">&#xe6e9;</span>3</div>
      </div>
    </div>
    <common-gallary :imgs="imgs" v-show="showGallary"
    @close="handleGallaryClose"></common-gallary>
  </div>
</template>

<script>
import CommonGallary from '@/common/gallary/Gallary'
export default {
  name:'DetailBanner',
  data () {
    return{
      imgs: ['http://img1.qunarzz.com/sight/p0/1510/23/23fa69e071d77b48.water.jpg_r_800x800_076cab54.jpg',
          'http://img1.qunarzz.com/sight/p0/1510/a8/a82d14064fac527e.water.jpg_r_800x800_d8b888ee.jpg',
          'http://img1.qunarzz.com/sight/p0/1510/38/38a36ffb0dbbfa1d.water.jpg_350x240_bd2c7d3c.jpg'],
      showGallary: false
    }
  },
  components: {
    CommonGallary
  },
  methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleGallaryClose () {
      this.showGallary = false
    }
  }
}
</script>

<style lang="stylus" scoped>
.banner
  position relative
  overflow hidden
  height 0
  padding-bottom 55%
  .banner-img
    width 100%
  .banner-info
    position absolute
    left 0
    right 0
    bottom 0
    display flex
    line-height .6rem
    color #ffffff
    background-image (linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.8)))
    .info-title
      flex 1
      font-size .32rem
      padding 0 .2rem
    .info-number
      margin .14rem .1rem .14rem 0
      padding 0 .3rem
      line-height .32rem
      height .32rem
      font-size .24rem
      border-radius .5rem
      background rgba(0,0,0,.8)
      .info-icon
        font-size .24rem
        padding 0 .1rem
</style>
